from pyecharts.charts import Line
from  pyecharts.options import InitOpts,TitleOpts,ToolboxOpts,VisualMapOpts
import pandas as pd

data=pd.read_excel("国家水平影响.xlsx")
level=list(data["国家水平"])
max=list(data["最大环境承载量"])
list=[list(z)for z in zip(level,max)]


line=Line()


line.add_xaxis(level)
line.add_yaxis("最大环境承载量",max)

line.set_global_opts(
    title_opts=TitleOpts("国家水平与最大环境承载量",pos_left="left"),
    visualmap_opts=VisualMapOpts(max_=1400000,min_=950000),
    toolbox_opts=ToolboxOpts(is_show=True)
)



line.render("国家水平.html")


